import React, { useEffect, useState } from 'react';
import { connect, history } from 'umi';
import Left from './left/index';

import styles from './index.less';

const Index: React.FC<any> = (props) => {
  const { index, dispatch } = props;
  useEffect(() => {
    dispatch({type: 'index/getInfo'});
  }, []);
  
  return (
    <div>
      <h1 className={styles.title}>Page index</h1>
      <Left index={index} />
    </div>
  );
};

export default connect(({ index }: any) => ({
  index,
}))(Index);
